Merged
Conversation
Dep + tooling alignment: - PHP >= 8.0, phpunit ^8|^9, phpstan ^2.0 at level max, phpstan-wordpress ^2, WPCS 3.x. - phpunit-polyfills widened to ^1 || ^2 || ^4; symfony/var-dumper + css-selector + dom-crawler unpinned. - Drop the WP 5.9/6.0/6.1 workflows; add WP_6_6..WP_6_9 workflows using codecov/codecov-action@v4 with the CODECOV_TOKEN secret. - Add .scrutinizer.yml and tests/.env. Suppress the WP 6.8 wp_is_block_theme early-call notice in tests/wp-config.php. - Tighten phpcs.xml (PSR12 file header exclude) and phpstan.neon.dist (drop bleedingEdge + bootstrapFiles). HTTP layer swap: - does_file_exist() and latest_version() use wp_remote_head() instead of raw curl / get_headers(). Consolidates two HTTP round trips into one, makes the network layer filterable via pre_http_request, and is fully mockable from the test suite. defer() / async() repurposed: - Use wp_script_add_data( $handle, 'strategy', 'defer'|'async' ) (WP 6.3+) instead of splatting attributes through the script_loader_tag filter. Dep-aware ordering, same rendered attribute at the browser. New features: - translations( string $domain, ?string $path = null ) -> wp_set_script_translations() - with_code( string $code, string $position = 'after' ) -> wp_add_inline_script() - with_style( string $css ) -> wp_add_inline_style() - for_block_editor( bool = true ) -> enqueue_block_editor_assets hook - for_block_style( string $block_name ) -> wp_enqueue_block_style() - register_only( bool = true ) -> skip wp_enqueue_* call - block_json( string $path ) -> register_block_type_from_metadata() All setters are additive/fluent; no BC break on existing public API. Tests: - 48 tests, 126 assertions covering every new setter (unit) and every new code path in register(), register_script(), register_style() (integration against $wp_scripts / $wp_styles / WP_Block_Type_Registry / has_filter). - 100% statement + method coverage on src/Enqueue.php. - Existing async/defer tests updated to assert on the new $strategy property. README rewritten for the new surface: Packagist/GitHub/WP-matrix/codecov/Scrutinizer badge layout, sections for Script Translations / Inline Snippets / Inline Styles / Register Only / Block Editor Assets / Block Styles / Block JSON, expanded Public Methods block, full 1.5.0 changelog, updated PHP Scoper wp-core-function list.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #26 +/- ##
==============================================
+ Coverage 86.11% 100.00% +13.88%
- Complexity 52 67 +15
==============================================
Files 1 1
Lines 144 203 +59
==============================================
+ Hits 124 203 +79
+ Misses 20 0 -20 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates the CI workflows, documentation, and configuration to support newer versions of WordPress (6.6–6.9) and PHP (8.0–8.4), while also adding new documentation for advanced enqueue features and introducing Scrutinizer CI for code quality analysis. The most important changes are grouped below:
CI/CD Workflow Updates:
Documentation Improvements:
README.mdto reflect the new supported versions, add workflow badges for the new test suites, and bump the release version to 1.5.0. [1] [2]for_block,for_block_editor,for_block_style, andblock_json). [1] [2]Code Quality and Analysis:
.scrutinizer.ymlconfiguration to enable Scrutinizer CI for PHP code quality checks, including analysis, duplication detection, and code style configuration.These changes modernize the package’s compatibility and CI coverage, improve documentation for advanced usage, and enhance code quality monitoring.